﻿<Window x:Class="P2.Cuberry.Modules.SimpleAccounting.FiTransaction.FiTransactionItemDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cal="http://www.codeplex.com/prism"
    xmlns:local="clr-namespace:P2.Cuberry.Modules.SimpleAccounting.FiTransaction"
    
    Height="389" Width="487"
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry"              
        Background="{DynamicResource P2BackgroundBrush}" 
        Loaded="Window_Loaded"
        >
    
    <Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
    </Window.Resources>

    <Grid>
<Grid.Resources>            
            <Image x:Key="SaveAndNewIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/SaveAndNew.ico" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/cancel.png" />

            <Image x:Key="BookIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/book16.gif" />
            <Image x:Key="CancelTransactionIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/cancelTransaction16.gif" />

            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/printer2.png" />
            <Image x:Key="FindIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/find16.gif" />
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->

        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderFiTransactionItem}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />

        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" 
                  cal:RegionManager.RegionName="{x:Static local:RegionNames.FiTransactionItemDetailMenu}" 
                  cal:RegionManager.RegionContext="{Binding Path=FiscalYearIDFiTransactionItemID}"
>
           
                <MenuItem x:Name="SaveBtn" InputGestureText="Ctrl+S" Header="{Translate SaveAndCloseBtn}" Command="{Binding FiTransactionItemSaveCommand}" Style="{StaticResource P2MenuItemStyleSaveAndClose}" />
                <MenuItem x:Name="SaveAndNewBtn" InputGestureText="Ctrl+S" Header="{Translate SaveAndNewBtn}" Command="{Binding FiTransactionItemSaveAndNewCommand}" Icon="{StaticResource SaveAndNewIcon}" Style="{StaticResource P2MenuItemStyle}" />

                <!--
                <MenuItem x:Name="CloseBtn" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding FiTransactionItemCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
 -->
            </Menu>
        </Border>
        <!-- Row 1 End -->
        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid >


                <Label HorizontalAlignment="Left" Margin="5,3,0,0" Name="FiAccountNoL" Width="120" Height="28" VerticalAlignment="Top" Content="{Translate FiAccountNoL}" ></Label>
                <TextBox  Margin="5,24,5,0" Name="FiAccountNo" Height="23" Width="120" Text="{Binding FiAccountNo, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left"  VerticalAlignment="Top" Style="{StaticResource P2TextBoxStyle}"/>
                <Button Margin="130,23,0,0" Height="23" Name="FindFiAccount" VerticalAlignment="Top" Width="23" Command="{Binding FiTransactionItemFindCommand}" HorizontalAlignment="Left">
                <Image  Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/Find.png"></Image>                    
                </Button>
                <Button Margin="155,23,0,0" Height="23" Name="RefreshFiAccount" VerticalAlignment="Top" Width="23" Command="{Binding FiAccountRefreshCommand}" HorizontalAlignment="Left">
                    <Image  Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/Refresh.ico"></Image>
                </Button>
                <Button Margin="180,23,0,0" Height="23" Name="FindFiAccountTree" VerticalAlignment="Top" Width="23" Command="{Binding FiTransactionItemFindAccountTreeCommand}" HorizontalAlignment="Left">
                    <Image  Source="/P2.Cuberry.Modules.SimpleAccounting.FiTransaction;component/Images/AddChild.png"></Image>
                </Button>
                <TextBox  Margin="5,51,5,0" Name="FiAccountName" Height="23" Width="250" Text="{Binding FiAccountName, Mode=OneWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left"  VerticalAlignment="Top" Style="{StaticResource P2TextBoxStyle}" IsEnabled="False"/>
<!--
                <ComboBox  Margin="95,51,5,0" Name="FiAccountID" Width="250" HorizontalAlignment="Left"  SelectedValue="{Binding FiAccountID}" 
                           ItemsSource="{Binding AvailableAccounts}"
                           IsReadOnly="True" SelectedValuePath="FiAccountID" DisplayMemberPath="FiAccountNameCur" Height="23" VerticalAlignment="Top" Style="{StaticResource P2ComboBoxStyle}" />
    -->            
                
                <Label  Height="28" HorizontalAlignment="Left" Margin="5,80,5,0" Name="BookingDescriptionL" VerticalAlignment="Top" Width="120" Content="{Translate BookingDescriptionL}" />
                <TextBox Margin="5,104,46,86" Name="BookingDescription" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Text="{Binding BookingDescription , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" />
                
                <Label  Margin="320,0,41,55" Name="ValueDateL" Height="28" Content="{Translate ValueDateL}" VerticalAlignment="Bottom"></Label>
                <DatePicker Margin="320,0,11,37" Name="ValueDate" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" SelectedDate="{Binding ValueDate, Mode=TwoWay}" Height="23" VerticalAlignment="Bottom" 
                                IsEnabled="{Binding NameEnabled}" />
                
                <Label HorizontalAlignment="Left" Margin="5,0,0,55" Name="FiAccountAmountDebitL" Width="120" Content="{Translate FiAccountAmountDebitL}" Height="28" VerticalAlignment="Bottom"></Label>
                <TextBox  Margin="5,0,0,37" Name="FiAccountAmountDebit" Height="23" Width="120" Text="{Binding FiAccountAmountDebit, StringFormat=F2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left"  VerticalAlignment="Bottom" Style="{StaticResource P2TextBoxStyle}" GotFocus="FiAccountAmountDebit_GotFocus" FlowDirection="LeftToRight"  TextAlignment="Right"/>
                <Label HorizontalAlignment="Left" Margin="5,0,0,29" Name="FiAccountAmountCreditL" Width="120" Height="28" VerticalAlignment="Bottom" Content="{Translate FiAccountAmountCreditL}" ></Label>
                <TextBox  Margin="5,0,0,5" Name="FiAccountAmountCredit" Height="23" Width="120" Text="{Binding FiAccountAmountCredit, StringFormat=F2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left"  VerticalAlignment="Bottom" Style="{StaticResource P2TextBoxStyle}" GotFocus="FiAccountAmountCredit_GotFocus" FlowDirection="LeftToRight" TextAlignment="Right" />
                
            </Grid>
        </Border>

    </Grid>
</Window>
